package si.yun.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import si.yun.service.SyCourseLogService;
import si.yun.utils.JsonData;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: 课程日志WEB层
 * @Description: TODO
 * @Author: 柴秋生
 * @Date 2021/8/28 11:49
 */
@Controller
@RequestMapping("/courseLog")
public class SyCourseLogController {
    @Autowired
    private SyCourseLogService syCourseLogService;
    /**
     * 查询课程日志
     * @Author : 柴秋生
     * @Date : 2021/8/28 11:59
     * @Param : []
     * @Return : si.yun.utils.JsonData
     */
    @ResponseBody
    @RequestMapping("/selCourseLog")
    public JsonData selCourseLog(Integer courseId){
        List<Map<String,Object>> selCourseLog=syCourseLogService.selCourseLog(courseId);
        return selCourseLog!=null? JsonData.buildSuccess(selCourseLog): JsonData.buildError("服务器端错误");
    }
}
